/*
 * @Description: 
 * @Autor: kaikaima
 * @Date: 2021-05-01 17:16:03
 * @LastEditors: kaikaima
 * @LastEditTime: 2021-05-01 17:37:02
 */

#include "M.h"

int main(int argc, char* argv[]){
    unsigned N=12,M=28;
    double** A=new double* [M];
    double* B=new double[M];
    for(int i=0;i<M;i++){
        A[i]=new double[N];
    }

    for(int i=0;i<M;i++){
        A[i][0]=1;
        for(int j=1;j<N;j++) std::cin>>A[i][j];
    }
    for(int i=0;i<M;i++) std::cin>>B[i];

    Matrix test(M,N);
    test.set(A);

    B=test.Least_squares(B);
    for(int i=0;i<N;i++)
    std::cout<<B[i]<<" ";
    std::cout<<std::endl;
    for(int i=0;i<M;i++) delete[] A[i];
    delete[] A;
    delete[] B;
    return 0;
}